import pyperclip
import tempfile

def get_clipboard():
    text = pyperclip.paste()
    if text != '':
        return {'success': True, 'text': text}
    try:
        from PIL import ImageGrab
        image = ImageGrab.grabclipboard()
        path = tempfile.mktemp(suffix=".png")
        image.save(path, "png")
        return {'success': True, 'image': path, 'message': 'You may use describe_image to recoginize the visual content of the image.'}
    except ChildProcessError:
        pass
    return {'success': False, 'message': 'The clipboard is empty.'}
